package com.tigerlihao.pos2camara;

public class Test {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		/*Vector head,view,wing;
		double heading,tilt,roll;

		head=new Vector(0,1,0);
		view=new Vector(0,0,-1);
		wing=new Vector(1,0,0);
		heading=322.4;
		tilt=14.8;
		roll=13;
		
		head.rotateTo(view, heading);
		wing.rotateTo(view, heading);
		head.rotateTo(wing, tilt);
		view.rotateTo(wing, tilt);
		wing.rotateTo(head, -roll);
		view.rotateTo(head, -roll);
		System.out.println("view vector:"+view.toString());
		System.out.println("Heading:"+view.getHeading());
		System.out.println("Tilt:"+view.getTilt());
		Vector vW=view.getWing();
		Vector hW=head.getWing();
		Vector vH=view.getHead();
		System.out.println("V Wing:"+vW.toString());
		System.out.println("H Wing:"+hW.toString());
		System.out.println("V Head:"+vH.toString());
		double dx=hW.x*vW.x+hW.y*vW.y+hW.z*vW.z;
		double dy=hW.x*vH.x+hW.y*vH.y+hW.z*vH.z;
		double r=Math.atan2(dy, dx)*180/Math.PI;*/
		//,lon,lat,hight,tilt,roll,heading
		System.out.print(generatePlaceMark(1,113.540535,22.3955,82,19.2,48.8,51.6));
		System.out.print(generatePlaceMark(2,113.540733,22.395851,98,17.7,50.5,13.8));
		System.out.print(generatePlaceMark(3,113.540665,22.396227,11,18.8,25.6,343.1));
		System.out.print(generatePlaceMark(4,113.540482,22.396591,128,15.7,14.7,334.2));
		System.out.print(generatePlaceMark(5,113.54026,22.396959,137,6.4,10.4,329.1));
		System.out.print(generatePlaceMark(6,113.540047,22.397287,139,8.5,9.1,327.9));
		System.out.print(generatePlaceMark(7,113.539818,22.397606,142,9.9,5.1,326.3));
		System.out.print(generatePlaceMark(8,113.539581,22.397919,149,5.9,2,325.2));
		System.out.print(generatePlaceMark(9,113.539345,22.398237,154,5.6,-1.7,326));
		System.out.print(generatePlaceMark(10,113.539124,22.39856,157,4,19,327.6));
		System.out.print(generatePlaceMark(11,113.538887,22.398872,158,1.7,49,323.4));
		System.out.print(generatePlaceMark(12,113.538551,22.399103,158,6,45.3,301.9));
		System.out.print(generatePlaceMark(13,113.538162,22.399221,160,-0.2,48.1,283.3));
		System.out.print(generatePlaceMark(14,113.537766,22.399221,161,-1.4,46.5,265.6));
		System.out.print(generatePlaceMark(15,113.537361,22.399055,161,-3.3,42.6,237.5));
		System.out.print(generatePlaceMark(16,113.537086,22.398767,161,-5.3,37.2,214.5));
		System.out.print(generatePlaceMark(17,113.536964,22.398371,160,-5.5,-1.1,189.6));
		System.out.print(generatePlaceMark(18,113.536888,22.397972,157,0.2,-25,191.7));
		System.out.print(generatePlaceMark(19,113.536743,22.397633,156,-0.6,29.8,206));
		System.out.print(generatePlaceMark(20,113.536613,22.397291,155,-3.5,43.1,194.1));
		System.out.print(generatePlaceMark(21,113.536667,22.396902,154,2.8,18.7,160.8));
		System.out.print(generatePlaceMark(22,113.536865,22.396572,155,-3,-0.5,151.1));
		System.out.print(generatePlaceMark(23,113.537048,22.396244,154,0.8,6.1,152.4));
		System.out.print(generatePlaceMark(24,113.537239,22.39592,155,3.3,5.6,151.2));
		System.out.print(generatePlaceMark(25,113.537437,22.395597,156,-1.5,6.3,150.4));
		System.out.print(generatePlaceMark(26,113.537651,22.395269,156,4.3,4.1,149.2));
		System.out.print(generatePlaceMark(27,113.537865,22.394938,156,-3.9,-1.4,151));
		System.out.print(generatePlaceMark(28,113.538071,22.39459,154,4.5,0.9,151.6));
		System.out.print(generatePlaceMark(29,113.538269,22.394251,154,0.1,8.9,152.7));
		System.out.print(generatePlaceMark(30,113.538467,22.393909,152,2,8.7,151.8));
		System.out.print(generatePlaceMark(31,113.538673,22.393581,157,1.3,9.3,147.8));
		System.out.print(generatePlaceMark(32,113.538895,22.393267,155,1.4,3.4,149));
		System.out.print(generatePlaceMark(33,113.539108,22.392939,152,4.6,8.1,148.6));
		System.out.print(generatePlaceMark(34,113.539322,22.392618,151,6.3,0.9,148.2));
		System.out.print(generatePlaceMark(35,113.539528,22.392292,150,2.6,3.5,151.1));
		System.out.print(generatePlaceMark(36,113.539726,22.391953,149,5.8,-7,151.8));
		System.out.print(generatePlaceMark(37,113.539894,22.391607,151,10.1,-13.5,157.3));
		System.out.print(generatePlaceMark(38,113.540001,22.39123,151,5.7,-7.7,168.8));
		System.out.print(generatePlaceMark(39,113.540054,22.390833,154,5.5,48,170.8));
		System.out.print(generatePlaceMark(40,113.540268,22.390526,154,1.1,48.3,134.5));
		System.out.print(generatePlaceMark(41,113.540695,22.390471,156,0.4,49.4,81.6));
		System.out.print(generatePlaceMark(42,113.541008,22.390696,160,-4.6,4.8,47.2));
		System.out.print(generatePlaceMark(43,113.541298,22.390978,160,3,42.1,44.9));
		System.out.print(generatePlaceMark(44,113.541504,22.391333,159,-3.6,48.3,15.4));
		System.out.print(generatePlaceMark(45,113.541451,22.391689,156,1.5,40.6,342.7));
		System.out.print(generatePlaceMark(46,113.541176,22.392019,156,-3.2,6.1,317.8));
		System.out.print(generatePlaceMark(47,113.540863,22.392317,156,1.3,-3,315.4));
		System.out.print(generatePlaceMark(48,113.54055,22.392624,156,2.3,-6.5,318.6));
		System.out.print(generatePlaceMark(49,113.540276,22.392956,158,-5.4,-0.2,323.6));
		System.out.print(generatePlaceMark(50,113.540047,22.393272,157,-1.1,0.9,326.5));
		System.out.print(generatePlaceMark(51,113.539825,22.393604,156,1.7,5.7,329));
		System.out.print(generatePlaceMark(52,113.539627,22.39394,159,-6.1,11.4,330.8));
		System.out.print(generatePlaceMark(53,113.539406,22.394278,159,-2.7,9,328.5));
		System.out.print(generatePlaceMark(54,113.539169,22.394619,159,-3.5,9.9,326.8));
		System.out.print(generatePlaceMark(55,113.538918,22.394957,157,0,11.7,324.7));
		System.out.print(generatePlaceMark(56,113.538666,22.395283,156,-4.1,6.2,324.5));
		System.out.print(generatePlaceMark(57,113.538414,22.395605,154,1.9,3.6,323.5));
		System.out.print(generatePlaceMark(58,113.53817,22.395927,153,-0.3,0.4,324.7));
		System.out.print(generatePlaceMark(59,113.537941,22.396246,150,4,2.7,326.5));
		System.out.print(generatePlaceMark(60,113.53772,22.396563,149,6.1,11.8,327.1));
		System.out.print(generatePlaceMark(61,113.537514,22.39687,150,2.5,-0.3,327.1));
		System.out.print(generatePlaceMark(62,113.537323,22.397186,149,0.6,-47.2,332.4));
		System.out.print(generatePlaceMark(63,113.537384,22.397554,146,10.9,-45.5,26.7));
		System.out.print(generatePlaceMark(64,113.53772,22.397738,147,8.9,-5.6,70.5));
		System.out.print(generatePlaceMark(65,113.538109,22.397827,149,11.3,20.7,74.1));
		System.out.print(generatePlaceMark(66,113.538483,22.397997,153,6.3,2.2,59.7));
		System.out.print(generatePlaceMark(67,113.538887,22.398186,156,6.5,-46.1,75.1));
		System.out.print(generatePlaceMark(68,113.539284,22.398138,160,7.2,-44.7,106.7));
		System.out.print(generatePlaceMark(69,113.539642,22.397877,164,4.9,-31.9,138.9));
		System.out.print(generatePlaceMark(70,113.539841,22.397554,166,3.4,-12.5,153.7));
		System.out.print(generatePlaceMark(71,113.540001,22.397207,165,-1.4,-8.9,157.4));
		System.out.print(generatePlaceMark(72,113.540154,22.396852,161,0.3,-0.7,158.7));
		System.out.print(generatePlaceMark(73,113.540291,22.396486,160,-0.6,5.1,159.6));
		System.out.print(generatePlaceMark(74,113.540443,22.396132,158,1.4,4.5,159.1));
		System.out.print(generatePlaceMark(75,113.540604,22.395782,156,-1.8,4.6,155.5));
		System.out.print(generatePlaceMark(76,113.540794,22.395454,156,2.4,6.4,149.8));
		System.out.print(generatePlaceMark(77,113.541039,22.395109,157,-3.2,1.2,145.8));
		System.out.print(generatePlaceMark(78,113.541275,22.394775,155,1.2,-2.1,146.8));
		System.out.print(generatePlaceMark(79,113.541496,22.394438,156,-1.8,-6.4,149.2));
		System.out.print(generatePlaceMark(80,113.541695,22.394093,155,-3.2,3.7,153.2));
		System.out.print(generatePlaceMark(81,113.541885,22.393736,157,-0.3,2.9,153.4));
		System.out.print(generatePlaceMark(82,113.542061,22.39337,158,-5.7,-46.9,160));
		System.out.print(generatePlaceMark(83,113.541992,22.392963,157,-2.5,-45.6,197));
		System.out.print(generatePlaceMark(84,113.541702,22.392651,148,2.4,-37,233.8));
		System.out.print(generatePlaceMark(85,113.541313,22.392536,145,5.4,-4.9,258.2));
		System.out.print(generatePlaceMark(86,113.540924,22.392473,145,1.3,2.2,259.4));
		System.out.print(generatePlaceMark(87,113.540527,22.392418,142,7.3,-45,260.7));
		System.out.print(generatePlaceMark(88,113.540138,22.392599,144,8.1,-30.3,312.9));
		System.out.print(generatePlaceMark(89,113.539886,22.39291,146,4.7,-5.1,325.5));
		System.out.print(generatePlaceMark(90,113.539665,22.393236,149,6.7,-6,328.6));
		System.out.print(generatePlaceMark(91,113.539452,22.393566,156,0.9,1.5,329.5));
		System.out.print(generatePlaceMark(92,113.539253,22.393908,154,1.1,4,329.8));
		System.out.print(generatePlaceMark(93,113.539032,22.394255,157,1.6,-0.7,328.5));
		System.out.print(generatePlaceMark(94,113.538826,22.394564,157,-1,0.3,327.5));
		System.out.print(generatePlaceMark(95,113.538612,22.394871,155,3.5,-0.4,327.6));
		System.out.print(generatePlaceMark(96,113.538383,22.395231,157,-1.8,0.4,330.4));
		System.out.print(generatePlaceMark(97,113.538193,22.395554,156,0.2,3.6,331.4));
		System.out.print(generatePlaceMark(98,113.538002,22.395887,154,0.9,8.4,330.9));
		System.out.print(generatePlaceMark(99,113.537796,22.396208,157,-2.7,6.5,329.6));
		System.out.print(generatePlaceMark(100,113.537582,22.396526,159,-3.1,10.8,326.3));
		System.out.print(generatePlaceMark(101,113.537354,22.396839,160,-1.2,8.7,324.8));
		System.out.print(generatePlaceMark(102,113.537117,22.397139,161,0,-15.7,322.7));
		System.out.print(generatePlaceMark(103,113.536903,22.397451,160,-4.6,-45.5,333.8));
		System.out.print(generatePlaceMark(104,113.536896,22.397816,154,-1.2,-45.8,7.1));
		System.out.print(generatePlaceMark(105,113.537155,22.39814,149,5.2,-41.8,51.7));
		System.out.print(generatePlaceMark(106,113.537567,22.398243,148,3.3,-5.9,80.8));
		System.out.print(generatePlaceMark(107,113.537987,22.398287,147,5.3,12.9,82.9));
		System.out.print(generatePlaceMark(108,113.538383,22.398386,146,3.5,-46.2,72.5));
		System.out.print(generatePlaceMark(109,113.53878,22.398346,142,6,-42,110.9));
		System.out.print(generatePlaceMark(110,113.53904,22.398077,145,3.3,-15.5,145.2));
		System.out.print(generatePlaceMark(111,113.539238,22.397711,143,3,-2.2,153.6));
		System.out.print(generatePlaceMark(112,113.539413,22.397383,145,2.5,-1.9,152.4));
		System.out.print(generatePlaceMark(113,113.539604,22.397051,148,2.5,0.9,150.8));
		System.out.print(generatePlaceMark(114,113.539818,22.396706,151,3.3,-4.5,150.9));
		System.out.print(generatePlaceMark(115,113.540024,22.396353,150,-0.8,-4.2,152.2));
		System.out.print(generatePlaceMark(116,113.54023,22.395988,148,1.2,-2.9,152.9));
		System.out.print(generatePlaceMark(117,113.540413,22.395611,150,-2,0.2,155.3));
		System.out.print(generatePlaceMark(118,113.540573,22.395277,149,1.1,9.2,156.1));
		System.out.print(generatePlaceMark(119,113.540749,22.394941,148,-3,7.2,153.4));
		System.out.print(generatePlaceMark(120,113.540932,22.394619,148,-1.2,9,150.7));
		System.out.print(generatePlaceMark(121,113.54113,22.394295,149,-4.1,7.7,149.1));
		System.out.print(generatePlaceMark(122,113.541351,22.393984,150,-10,-24.1,146.8));
		System.out.print(generatePlaceMark(123,113.54155,22.393669,139,-12.8,-45.8,153.3));
		System.out.print(generatePlaceMark(124,113.541527,22.393274,128,-7,-46.2,195.4));
		System.out.print(generatePlaceMark(125,113.541267,22.392927,115,-4.7,-44,224.5));
		System.out.print(generatePlaceMark(126,113.540916,22.392752,108,4,-21.7,247.5));
		System.out.print(generatePlaceMark(127,113.540535,22.392666,106,-0.2,-0.3,257.8));
		System.out.print(generatePlaceMark(128,113.5401,22.392578,102,5.3,11.8,257.8));
		System.out.print(generatePlaceMark(129,113.539688,22.392458,103,5.6,14.9,251.4));
		System.out.print(generatePlaceMark(130,113.53933,22.392309,104,7.8,14.1,243.5));
		System.out.print(generatePlaceMark(131,113.538963,22.392103,104,8,-0.2,237.3));
		System.out.print(generatePlaceMark(132,113.538612,22.391886,103,-3.5,-42.3,241.5));
		System.out.print(generatePlaceMark(133,113.53817,22.391869,95,0,-43.9,282.5));
		System.out.print(generatePlaceMark(134,113.537865,22.392097,94,7.3,-39.7,321.5));
		System.out.print(generatePlaceMark(135,113.537727,22.392481,95,1.5,-8,346.8));
		System.out.print(generatePlaceMark(136,113.537651,22.392879,93,0.1,4.8,348.7));
		System.out.print(generatePlaceMark(137,113.537575,22.393272,91,-8.5,-46.4,349.7));
		System.out.print(generatePlaceMark(138,113.537682,22.393669,84,-7,-41.4,23.9));
		System.out.print(generatePlaceMark(139,113.537987,22.39395,80,-1.1,-16.7,53));
		System.out.print(generatePlaceMark(140,113.538353,22.39414,77,0.3,-12,63.6));
		System.out.print(generatePlaceMark(141,113.538467,22.394184,77,0.6,-5.2,66.4));
		System.out.print(generatePlaceMark(142,113.538574,22.394222,77,-0.9,1.8,67.9));
		System.out.print(generatePlaceMark(143,113.538673,22.394253,77,-0.2,0.7,68.5));
		System.out.print(generatePlaceMark(144,113.53878,22.394287,77,1.7,5,68.5));
		System.out.print(generatePlaceMark(145,113.538872,22.394318,77,0.2,10.4,69.2));
		System.out.print(generatePlaceMark(146,113.538963,22.394352,77,-3.3,12.1,67.6));
		System.out.print(generatePlaceMark(147,113.539055,22.394388,77,-3.5,16.8,65.2));
		System.out.print(generatePlaceMark(148,113.539139,22.394426,76,-2.1,7.7,63.9));
		System.out.print(generatePlaceMark(149,113.539215,22.394468,76,-3.2,9,60.3));
		System.out.print(generatePlaceMark(150,113.539291,22.394514,76,-2.3,2.9,55.6));
		System.out.print(generatePlaceMark(151,113.539368,22.394567,75,-1,4.4,52.8));
		System.out.print(generatePlaceMark(152,113.539444,22.394619,76,0.2,-3.4,52.7));
		System.out.print(generatePlaceMark(153,113.539513,22.39467,76,-5.9,-6,52.1));
		System.out.print(generatePlaceMark(154,113.539581,22.394722,76,-34.3,-18,50.9));
		System.out.print(generatePlaceMark(155,113.539635,22.394764,75,-63.3,-1.6,54));
		System.out.print(generatePlaceMark(156,113.539665,22.394787,74,-75.5,-82.9,62.9));
		System.out.print(generatePlaceMark(157,113.53965,22.394789,73,-70.7,-137.4,8.7));
		System.out.print(generatePlaceMark(158,113.539612,22.394773,73,-53.8,-151.7,249.3));
		System.out.print(generatePlaceMark(159,113.539566,22.394749,73,-33.9,-136.2,238.6));
		System.out.print(generatePlaceMark(160,113.539528,22.394716,72,-33.8,-134,232.3));
		System.out.print(generatePlaceMark(161,113.539505,22.394684,71,-37.2,-126.4,218.6));
		System.out.print(generatePlaceMark(162,113.539505,22.394661,70,-37.8,-140.4,197.6));
		System.out.print(generatePlaceMark(163,113.539497,22.394648,71,-11.7,-155.6,201.1));
		System.out.print(generatePlaceMark(164,113.53949,22.394648,70,-13.2,-179.6,214.3));
		System.out.print(generatePlaceMark(165,113.539474,22.394653,69,-29,163.9,225.3));
		System.out.print(generatePlaceMark(166,113.539459,22.394661,69,-17.7,-178,289.5));
		System.out.print(generatePlaceMark(167,113.539444,22.394672,68,-38.3,-166.9,307.1));
		System.out.print(generatePlaceMark(168,113.539429,22.394686,67,-32.9,-170.9,306.5));
		System.out.print(generatePlaceMark(169,113.539406,22.394703,67,-6.3,-168.8,305.2));
		System.out.print(generatePlaceMark(170,113.539383,22.394714,66,2,-153.2,298.9));
		System.out.print(generatePlaceMark(171,113.539368,22.394726,65,-4,-179.7,297.2));
		System.out.print(generatePlaceMark(172,113.539352,22.394735,65,-1.6,174.6,296.9));
		System.out.print(generatePlaceMark(173,113.539345,22.394745,64,10.2,174.5,302.9));
		System.out.print(generatePlaceMark(174,113.539337,22.394751,63,2.2,176.5,301.7));
		System.out.print(generatePlaceMark(175,113.539337,22.394753,64,2.2,176.6,321.4));
		System.out.print(generatePlaceMark(176,113.539337,22.394754,65,1.8,176.4,330.5));
		System.out.print(generatePlaceMark(177,113.539345,22.394758,64,-1.3,174.5,353.8));
		System.out.print(generatePlaceMark(178,113.539345,22.394762,64,-3.2,171.9,10.9));
		System.out.print(generatePlaceMark(179,113.539345,22.394766,63,1.1,172.7,9.1));
		System.out.print(generatePlaceMark(180,113.539345,22.394766,63,0.1,172.7,7.7));
		System.out.print(generatePlaceMark(181,113.539345,22.39477,62,0.3,172.9,13.4));
		System.out.print(generatePlaceMark(182,113.539352,22.394773,62,0.1,174.3,13.4));
		System.out.print(generatePlaceMark(183,113.539352,22.39477,63,-1.1,174.5,13.4));
		System.out.print(generatePlaceMark(184,113.539352,22.394772,63,-0.1,173.9,13.4));
		System.out.print(generatePlaceMark(185,113.539352,22.394772,63,0.2,174.4,13.4));
		System.out.print(generatePlaceMark(186,113.539352,22.394772,63,0.2,174.5,13.4));
		System.out.print(generatePlaceMark(187,113.539345,22.394772,63,0.4,175,13.4));
		System.out.print(generatePlaceMark(188,113.539345,22.394772,63,0.4,175.2,13.4));
		System.out.print(generatePlaceMark(189,113.539345,22.39477,62,0.7,175.6,13.4));
		System.out.print(generatePlaceMark(190,113.539345,22.39477,62,0.7,175.7,13.4));
		System.out.print(generatePlaceMark(191,113.539345,22.39477,62,0.9,176.1,13.4));
		System.out.print(generatePlaceMark(192,113.539345,22.39477,62,0.9,176.2,13.4));
		System.out.print(generatePlaceMark(193,113.539345,22.39477,62,1.1,176.9,13.4));
		System.out.print(generatePlaceMark(194,113.539345,22.39477,62,1.2,177,13.4));
		System.out.print(generatePlaceMark(195,113.539345,22.39477,62,1.4,177.5,13.4));
		System.out.print(generatePlaceMark(196,113.539345,22.39477,62,1.4,177.6,13.4));
		System.out.print(generatePlaceMark(197,113.539337,22.39477,61,1.6,177.9,13.4));
		System.out.print(generatePlaceMark(198,113.539337,22.394768,61,1.6,178,13.4));
		System.out.print(generatePlaceMark(199,113.539337,22.394768,61,1.8,178.4,13.4));
		System.out.print(generatePlaceMark(200,113.539337,22.394768,61,2.5,178.2,13.4));
	}
	static String generatePlaceMark(int num,double lon,double lat, double alt,double tilt,double roll,double heading){
		Vector head,view,wing;
		head=new Vector(0,1,0);
		view=new Vector(0,0,-1);
		wing=new Vector(1,0,0);
		
		head.rotateTo(view, heading);
		wing.rotateTo(view, heading);
		head.rotateTo(wing, tilt);
		view.rotateTo(wing, tilt);
		//wing.rotateTo(head, -roll);
		view.rotateTo(head, -roll);
		Vector vW=view.getWing();
		Vector hW=head.getWing();
		Vector vH=view.getHead();
		double dx=hW.x*vW.x+hW.y*vW.y+hW.z*vW.z;
		double dy=hW.x*vH.x+hW.y*vH.y+hW.z*vH.z;
		double r=Math.atan2(dy, dx)*180/Math.PI;
		String p="<Placemark>\n";
		p+="<name>P "+num+"</name>\n";
		p+="<Camera>\n";
		p+="<longitude>"+lon+"</longitude>\n";
		p+="<latitude>"+lat+"</latitude>\n";
		p+="<altitude>"+alt+"</altitude>\n";
		p+="<heading>"+view.getHeading()+"</heading>\n";
		p+="<tilt>"+view.getTilt()+"</tilt>\n";
		p+="<roll>"+r+"</roll>\n";
		p+="<altitudeMode>relativeToGround</altitudeMode>\n";
		p+="</Camera>\n";

		p+="<Point>\n";
		p+="<extrude>1</extrude>\n";
		p+="<altitudeMode>relativeToGround</altitudeMode>\n";
		p+="<coordinates>"+lon+","+lat+","+alt+"</coordinates>\n";
		p+="</Point>\n";
		p+="</Placemark>\n";
		return p;
	} 
}
